package com.lucien.Search;

public class SeqSearch {
    public static void main(String[] args) {
        int [] arr = {12,43,-12,4,67,8};
        int index = seqSearch(arr,-12);
        if (index == -1){
            System.out.println("没有找到");
        }else{
            System.out.println("找到了下标为："+index);
        }
    }
    public static int seqSearch(int [] arr,int value){
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] == value){
                return i;
            }
        }
        return -1;
    }
}
